package com.example.testdemo.demos.web.Controller;


import com.example.testdemo.demos.web.Config.Result;
import com.example.testdemo.demos.web.Service.WeiXinService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.IOException;

@RestController
@CrossOrigin
@RequestMapping("/wx")
@ResponseBody
public class WeiXinController {

    @Resource
    private WeiXinService weiXinService;

    /**
     * 获取微信小程序手机号码
     * @param code
     * @return
     * @throws IOException
     */
    @PostMapping("/getCellPhone")
    public Result CellPhone(String code) throws IOException {
        return weiXinService.PhoneNumber(code);
    }
}
